<?php
require('home/model/model.php');
$conn=new model();
$u=$_POST["uname"];
$p=$_POST["pwd"];
$sql="select * from users where uname='$u' and password=md5('$p')";
echo $sql;
$rs=mysql_query($sql);
$num=mysql_num_rows($rs);
if($num>0)
{
session_start();
$_SESSION["uname"]=$u;
header("location:index.php");

}
else
header("location:index.php?re=1&msg=登录失败，请重新登录");
?>